<template>
  <div style="width: 100%; margin-top: 15px; display: flex; justify-content: center; align-items: center">
    <el-pagination
      :background="true"
      :page-size="20"
      :total="total"
      :current-page="currentPage"
      layout="prev,pager,next,jumper,total"
      :hide-on-single-page="false"
      @current-change="currentChange"
    />
  </div>
</template>
<script>
export default {
  name: 'Pagination',
  props: {
    total: {
      type: Number,
      default: 0
    },
    currentPage: {
      type: Number,
      default: 1
    }
  },
  methods: {
    // event 就是当前的页号
    currentChange(event) {
      this.$emit('current-change', event)
    }
  }
}
</script>
